package com.yuanfengerp.basicInfoManage.supplierInfo.contorller;

import com.yuanfengerp.basicInfoManage.supplierInfo.model.Supplierinfo;
import com.yuanfengerp.basicInfoManage.supplierInfo.service.impl.SupplierinfoImpl;
import com.yuanfengerp.publicUtil.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
public class SupplierCon {
    @Autowired
    SupplierinfoImpl slil;
    @PostMapping("/selectSupplierAll")
    public Result<List<Supplierinfo>> selectSupplierAll(@RequestBody Map<String ,Object> params){
        return slil.selectSupplierAll(params);
    }

    @PostMapping("/selectSupplier")
    public Result<Supplierinfo> selectSupplier(String id){
        return slil.selectSupplier(id);
    }

    @PostMapping("/addSupplier")
    public Result<String> addSupplier( @RequestBody Supplierinfo supplierinfo){
        return slil.addSupplier(supplierinfo);
    }

    @PostMapping("/updateSupplier")
    public Result<String> updateSupplier(@RequestBody Supplierinfo supplierinfo){
        return slil.updateSupplier(supplierinfo);
    }
}
